import React from 'react';
import { Redirect } from 'react-router-dom';

// import WYDiscover from 'views/discover';
// import WYFriend from 'views/friend';
// import WYMine from 'views/mine';
// 懒加载
const WYFriend = React.lazy(()=>import('views/friend'))
const WYDiscover = React.lazy(_=>import('views/discover'))
const WYMine = React.lazy(_=>import('views/mine'))

const WYRecommend = React.lazy(_=>import('views/discover/c-pages/recommend'))
const WYSongs = React.lazy(_=>import('views/discover/c-pages/songs'))
const WYDjradio = React.lazy(_=>import('views/discover/c-pages/djradio'))
const WYArtist = React.lazy(_=>import('views/discover/c-pages/artist'))
const WYAlbum = React.lazy(_=>import('views/discover/c-pages/album'))
const WYPlayer = React.lazy(_=>import('views/player'))
const WYRanking = React.lazy(_=>import('views/discover/c-pages/ranking'))


// import WYRecommend from "views/discover/c-pages/recommend";
// import WYSongs from "views/discover/c-pages/songs";
// import WYDjradio from "views/discover/c-pages/djradio";
// import WYArtist from "views/discover/c-pages/artist";
// import WYAlbum from "views/discover/c-pages/album";
// import WYPlayer from "views/player";

const routers = [
    {
        path:'/',
        exact:true,
        render:()=>(<Redirect to='/discover/album'/>)
    },
    {
        path:'/discover',
        component:WYDiscover,
        routes: [
            {
              path: "/discover",
              exact: true,
              render: () => (
                <Redirect to="/discover/recommend"/>
              )
            },
            {
              path: "/discover/recommend",
              component: WYRecommend
            },
            {
              path: "/discover/ranking",
              component: WYRanking
            },
            {
              path: "/discover/songs",
              component: WYSongs
            },
            {
              path: "/discover/djradio",
              exact: true,
              component: WYDjradio
            },
            {
              path: "/discover/artist",
              component: WYArtist
            },
            {
              path: "/discover/album",
              component: WYAlbum
            },
            {
              path: "/discover/player",
              component: WYPlayer
            }
          ]
    },
    {
        path:'/friend',
        exact:true,
        component:WYFriend
    },
    {
        path:'/mine',
        exact:true,
        component:WYMine
    },
    
]
// 这里可以搞成自动导入 就是左边新建文件夹 右边就直接导入push到routers里面-不需要的可以另建一个pages文件夹管理

export default routers ; 